﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Net.Mail;

namespace TestProject
{
	[TestClass]
	public class MailMessageAddressTest
	{
		//[TestMethod]
		//public void TestFolding()
		//{
		//    var recepients = new MailAddressCollection();
		//    Net.Mail.MailMessageEx.PopulateAddressList("abc@def,      ghi@klm, \r\n \r\n    nop@rst", recepients);
		//    Assert.AreEqual<int>(recepients.Count, 3);
		//    MailAddress ma = recepients[0];
		//    Assert.AreEqual<string>(ma.Address, "abc@def");
		//    ma = recepients[1];
		//    Assert.AreEqual<string>(ma.Address, "ghi@klm");
		//    ma = recepients[2];
		//    Assert.AreEqual<string>(ma.Address, "nop@rst");
		//}

		//[TestMethod]
		//public void TestDisplayNames()
		//{
		//    var recepients = new MailAddressCollection();
		//    Net.Mail.MailMessageEx.PopulateAddressList("\"Joe & J. Harvey\" <ddd @Org>, JJV @ BBN", recepients);
		//    Assert.AreEqual<int>(recepients.Count, 2);
		//    MailAddress ma = recepients[0];
		//    Assert.AreEqual<string>(ma.DisplayName, "Joe & J. Harvey");
		//    Assert.AreEqual<string>(ma.Address, "ddd@Org");
		//    ma = recepients[1];
		//    Assert.AreEqual<string>(ma.DisplayName, "");
		//    Assert.AreEqual<string>(ma.Address, "JJV@BBN");
		//}

		//[TestMethod]
		//public void TestAddressA11()
		//{
		//    var recepients = new MailAddressCollection();
		//    Net.Mail.MailMessageEx.PopulateAddressList("Alfred Neuman <Neuman@BBN-TENEXA>", recepients);
		//    Assert.AreEqual<int>(recepients.Count, 1);
		//    MailAddress ma = recepients[0];
		//    Assert.AreEqual<string>(ma.DisplayName, "Alfred Neuman");
		//    Assert.AreEqual<string>(ma.Address, "Neuman@BBN-TENEXA");
		//}

		//[TestMethod]
		//public void TestAddressA13()
		//{
		//    var recepients = new MailAddressCollection();
		//    Net.Mail.MailMessageEx.PopulateAddressList("Wilt . (the  Stilt) Chamberlain@NBA.US", recepients);
		//    Assert.AreEqual<int>(recepients.Count, 1);
		//    MailAddress ma = recepients[0];
		//    Assert.AreEqual<string>(ma.Address, "Chamberlain@NBA.US"); // !!!
		//}

		//[TestMethod]
		//public void TestAddressA15()
		//{
		//    var recepients = new MailAddressCollection();
		//    Net.Mail.MailMessageEx.PopulateAddressList(
		//        "Gourmets:  Pompous Person <WhoZiWhatZit@Cordon-Bleu>, \r\n" +
		//            " Childs@WGBH.Boston, Galloping Gourmet@ \r\n" +
		//            " ANT.Down-Under (Australian National Television), \r\n" +
		//            " Cheapie@Discount-Liquors;, \r\n" +
		//        " Cruisers:  Port@Portugal, Jones@SEA;, \r\n" +
		//        " Another@Somewhere.SomeOrg",
		//        recepients);
		//    Assert.AreEqual<int>(7, recepients.Count);
		//    MailAddress ma = recepients[0];
		//    Assert.AreEqual<string>("Pompous Person", ma.DisplayName);
		//    Assert.AreEqual<string>("WhoZiWhatZit@Cordon-Bleu", ma.Address);
		//}

		//[TestMethod]
		//public void TestAddressLists()
		//{
		//    var recepients = new MailAddressCollection();
		//    Net.Mail.MailMessageEx.PopulateAddressList(
		//        "Important folk: \r\n" +
		//        " Tom Softwood <Balsa@Tree.Root>, \r\n" +
		//        " \"Sam Irving\"@Other-Host;, \r\n" +
		//        " Standard Distribution: \r\n" +
		//        " /main/davis/people/standard@Other-Host, \r\n" +
		//        " \"<Jones>standard.dist.3\"@Tops-20-Host;", recepients);
		//    Assert.AreEqual<int>(recepients.Count, 4);
		//    MailAddress ma = recepients[0];
		//    Assert.AreEqual<string>("Tom Softwood", ma.DisplayName);
		//    Assert.AreEqual<string>("Balsa@Tree.Root", ma.Address);
		//    ma = recepients[1];
		//    Assert.AreEqual<string>("\"Sam Irving\"@Other-Host", ma.Address);
		//    ma = recepients[2];
		//    Assert.AreEqual<string>("/main/davis/people/standard@Other-Host", ma.Address);
		//    ma = recepients[3];
		//    Assert.AreEqual<string>("\"<Jones>standard.dist.3\"@Tops-20-Host", ma.Address);
		//}

	}
}
